package com.sgl.service;

import com.sgl.dao.AcceptPayOrderMapper;
import com.sgl.entity.AcceptPayOrder;
import com.sgl.entity.MybatisParamVo;
import com.sgl.util.PageBean;
import org.apache.ibatis.annotations.Param;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class AcceptPayOrderService {
    @Autowired
    AcceptPayOrderMapper acceptPayOrderMapper;

    /**
     *
     * @param orderId 订单id
     * @return 根据id查询出来的订单信息
     */
    public AcceptPayOrder  getPayOrderByOrderId(@Param("orderId") String orderId){
        AcceptPayOrder  order = acceptPayOrderMapper.getPayOrderByOrderId(orderId);
        return order;
    }

    /**
     *
     * @param acceptPayOrder
     * @return
     */
    public Integer insertPayOrder(AcceptPayOrder acceptPayOrder){
        Integer integer = acceptPayOrderMapper.insertPayOrder(acceptPayOrder);
        return integer;
    }

    public Integer changeStatiusByid(Long id){
        return  acceptPayOrderMapper.changeStatusById(id);
    }

    public  List<AcceptPayOrder> findList(PageBean<AcceptPayOrder> pageBean){
        return  acceptPayOrderMapper.findList(pageBean);
    }

    public Integer countList(PageBean<AcceptPayOrder> pageBean){
        return acceptPayOrderMapper.countList(pageBean);
    }

    public Integer update(AcceptPayOrder order){
        return acceptPayOrderMapper.update(order);
    }

    public Integer delete(@Param("ids") List<String> ids){
        return  acceptPayOrderMapper.delete(ids);
    }

    public  Integer changeStatusByIdOrder(AcceptPayOrder order){
        return acceptPayOrderMapper.changeStatusByIdOrder(order);
    }

    public Integer changeStatusByParam(MybatisParamVo<AcceptPayOrder> order){
        return acceptPayOrderMapper.changeStatusByParam(order);
    }
}
